/*
 * os_struct.h --- os struct for use to odf project. 
 *
 * Modefied for use in linux user space by MingLiang.Lu	.
 * Any bugs are my fault,
 * 
 *
 */

#ifndef __OS_STRUCT_H
#define __OS_STRUCT_H 

typedef struct os_boardinfo {
	unsigned char uuid[16];
	unsigned char deviceType;
	unsigned char manufacturer[4];
	unsigned char sortStyle;
	unsigned char ipaddr[4];
	unsigned char netmask[4];
	unsigned char gateway[4];
	unsigned char seraddr[4];
	unsigned char port[2];
	unsigned char deviceName[80];
	unsigned char frameNums;
	unsigned char frameactive[24];
	unsigned char totalactiveDevices;//<= 24
	unsigned short sf_version;
	unsigned short hd_version;
	unsigned char mac[6];
}OS_BOARD;

typedef struct os_uart0_struct{
	unsigned char  rxBuf[2300];
	unsigned char  txBuf[24][600];
	unsigned char  tx;
	unsigned char  rx;
	unsigned short idex;
}OS_UART;//just for mainBoard

typedef struct os_netPart{
	unsigned char alarmInfo[2048];
	unsigned char reSourceInfo[18000];
	unsigned char rxBuf[300];
	unsigned char txBuf[300];
	unsigned char time[30];
	unsigned char Local_alarm;
	unsigned char Local_reSource;
	unsigned char LocalTx;
	unsigned char LocalRx;
	unsigned char TimeFlag;
}OS_NET;//just for net-part

typedef struct os_server{
	unsigned char new_oders[300];
	unsigned char del_oders[300];
	unsigned char mul_new[5][300];
	unsigned char newPorts;
	unsigned char delPorts;
	unsigned char mulPorts[5];
}OS_SERVER;//just for diff frames

//used to Share Memory System.
struct myShmType {
	unsigned char reSource[20480];
	unsigned char alarm[2400];
	unsigned char mobileTxBuff[300];
	unsigned char mobileRxBuff[300];
	unsigned char netTxBuff[300];
	unsigned char netRxBuff[300];
	unsigned char netRx;
	unsigned char netTx;
	unsigned char mobileTx;
	unsigned char mobileRx;
	unsigned char alarmFlag;
	unsigned char wr_time;
	unsigned char rd_time;
	unsigned char reSourceFlag;
	unsigned int  nPendingBit;
	unsigned int  nHandingBit;
	struct os_boardinfo board;
};

typedef struct os_cmd_list {
	unsigned char nettasks;
	unsigned char mobiletasks;
	/* cmd list */
	unsigned char rd_dev_conf_info;//0x01
	unsigned char rd_fr_info;//0x02
	unsigned char rd_tray_info;//0x03
	unsigned char rd_port_info;//0x04
	unsigned char rd_version;//0x05
	unsigned char update; //0x06
	unsigned char wr_eid_info;//0x07
	unsigned char rd_dev_alarm;//0x09
	unsigned char alarm_verify;//0a
	unsigned char wr_dev_info;//0c
	unsigned char wr_time;//0x15
	unsigned char rd_time;//0x16
	unsigned char new_oders;//0xd
	unsigned char dev_checkself;
	unsigned char leds_test;
	unsigned char wr_uuid;
	unsigned char resource;
	unsigned char pollinfo;
	unsigned char second_collect;
	unsigned char orderOperations;
	unsigned char new_double_ports;
	unsigned char new_signle_port;
	unsigned char del_signle_port;
	unsigned char remove_double_ports;
	unsigned char port_change_position;
	unsigned char mutiplies_ports;
	unsigned char port_appoint;
	unsigned char new_oder_between_two_frames;
	unsigned char del_ports_between_two_frames;
	unsigned char mutiplies_ports_between_frames; 
}CMD_LIST;


#endif //end of __OS_STRUCT_H

